var request = require('../../utils/request.js');
Page({
    data: {
        type: '寻物启事',
        title: '表白墙',
        date: '2021-08-04',
        text: '正文区域(此提示不显示)',
        qq: '',
        wechat: '',
        tel: '',
        mail: '',
        tailShow: true
    },
    onLoad(){
        var pages = getCurrentPages()
        var lastPage = pages[pages.length - 2]
        if(lastPage==undefined) return
        console.log(lastPage.data)
        let data = lastPage.data
        if(data.qq==''&&
        data.wechat==''&&
        data.tel==''&&
        data.mail==''){
            this.setData({
                tailShow: false
            })
        } else {
            this.setData({
                tailShow: true
            })
        }
        this.setData(data)
        var date=new Date()
        this.setData({
            date:date.getFullYear()+'-'+(date.getMonth()+1)+'-'+date.getDate()
        })
    },
    goBack(){
        qq.navigateBack()
    },
    submit(){
        console.log("提交")
        var pages = getCurrentPages()
        var lastPage = pages[pages.length - 2]
        lastPage.realSubmit()
    }
})